<template>
  <div class="l-from-body">
    <el-form
      :model="formData"
      :rules="rules"
      size="mini"
      ref="form"
      label-width="80px"
    >
      <el-col :span="24">
        <el-form-item :label="$t('条件')" prop="id">
          <l-select
            v-model="formData.id"
            :placeholder="$t('please select上下级')"
            :options="options"
            @change="handleChange"

            valueKey="funIndex"
            labelKey="itemName"
          ></l-select>
        </el-form-item>
      </el-col>
    </el-form>
  </div>
</template>
<script>
export default {
  name: "auditor-level-form",
  data() {
    return {
      formData: {
        name: "",
        type: "10",
        id: "",
      },
      rules: {
        id: [{ required: true, message: this.$t("please select上下级") }],
      },
      options: [],
    };
  },
  created() {},
  methods: {
    init(options){
        this.options = options;
    },
    resetForm() {
      this.$refs.form && this.$refs.form.resetFields();
    },
    // 校验表单
    validateForm(callback) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          callback();
        }
      });
    },
    setForm(data) {
      this.formData = this.$deepClone(data);
    },
    getForm() {
      return this.$deepClone(this.formData);
    },
    handleChange(val) {
      this.formData.name = val.itemName;
    },
  },
};
</script>
